Paint label background
authorPaolo Borelli <pborelli@gnome.org>
Fri, 24 Feb 2012 13:30:49 +0000 (14:30 +0100)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 30 Apr 2012 17:13:25 +0000 (13:13 -0400)
Make GtkLabel respect background css properties.

https://bugzilla.gnome.org/show_bug.cgi?id=670743

gtk/gtklabel.c

index 14c0f88d8ea19e7b24e56072a2a2f23a36ec7329..b481ac5672e2273104502bf9c1fcf8ce91317890 100644 (file)
@@ -4035,13 +4035,20 @@ gtk_label_draw (GtkWidget *widget,
 
   gtk_label_ensure_layout (label);
 
+  context = gtk_widget_get_style_context (widget);
+  gtk_widget_get_allocation (widget, &allocation);
+
+  gtk_render_background (context, cr,
+                         0, 0,
+                         allocation.width, allocation.height);
+  gtk_render_frame (context, cr,
+                    0, 0,
+                    allocation.width, allocation.height);
+
   if (priv->text && (*priv->text != '\0'))
     {
       get_layout_location (label, &x, &y);
 
-      context = gtk_widget_get_style_context (widget);
-      gtk_widget_get_allocation (widget, &allocation);
-
       cairo_translate (cr, -allocation.x, -allocation.y);
 
       gtk_render_layout (context, cr,